<%@ page language="java" pageEncoding="UTF-8"%>  
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>  
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>  
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ include file="../header.jsp"%>
<jsp:include page="../js.jsp"/>
<div class="content-wrapper" style="font-family: '微软雅黑';">
<input type="hidden" id="ctx" value="<%=request.getContextPath()%>"/>
  <!-- Content Header (Page header) -->
  <section class="content-header">
    <h1>
      ${module } <small>Control panel</small>
    </h1>
    <ol class="breadcrumb">
      <li><a href=""><i class="fa fa-dashboard"></i>主页</a></li>
      <li class="active">充值金额添加</li>
    </ol>
  </section>
  <!-- Main content -->
  <section class="content">
    <div class="row">
      <div class="col-xs-12">
        <div class="box">
          <div class="box-header">
          <div>  
    <div>
        编码： 
        <input type="text" id="listCode" value="${recharge.listCode}"/>
    </div>
    <div>
        描述： <input type="text" id="listDesc" value="${recharge.listDesc}"/>
    </div>
    <div>
        充值金额： <input type="text" id="amount" value="${recharge.amount}"/>
    </div>
    <div>
        赠送金额： <input type="text" id="giveAmount" value="${recharge.giveAmount}"/>
    </div>
    <div>
        有效期开始时间： <input type="text" id="activeTimeBegin" value="${recharge.activeTimeBegin}"/>
    </div>
    <div>
        有效期结束时间： <input type="text" id="activeTimeEnd" value="${recharge.activeTimeEnd}"/>
    </div>
    <div>
        状态： <select id="status">  
  <option value ="1" <c:if test="${recharge.status==1}">selected="selected"</c:if>>未激活</option>  
  <option value ="0"  <c:if test="${recharge.status==0}">selected="selected"</c:if>>已激活</option>  
</select> 
        <input type="button" onclick="insertRecord()"  value="保存">  
    </div>
    </div>  
          </div>
          <!-- /.box-header -->
          <div class="box-body">

    </div>
          <!-- /.box-body -->
        </div>
        <!-- /.box -->
      </div>
      <!-- /.col -->
    </div>
    <!-- /.row -->
    <!--  显示下面的分页控件  -->
  </section>
  <!-- /.content -->
</div>
<script type="text/javascript">
$('#activeTimeBegin').datetimepicker({lang:'ch',timepicker:true});
$('#activeTimeEnd').datetimepicker({lang:'ch',timepicker:true});
function insertRecord(){
	var listCode=$('#listCode').val();
	var listDesc=$('#listDesc').val();
	var amount=$('#amount').val();
	var giveAmount=$('#giveAmount').val();
	var status=$('#status').val();
	var activeTimeBegin=$('#activeTimeBegin').val();
	var activeTimeEnd=$('#activeTimeEnd').val();
	if(listCode==null||listCode.trim()==''){
		alert("编码不能为空");
		return;
	}
	if(listDesc==null||listDesc.trim()==''){
		alert("描述不能为空");
		return;
	}
	if(amount==null||amount.trim()==''){
		alert("充值金额不能为空");
		return;
	}
	if(giveAmount==null||giveAmount.trim()==''){
		alert("赠送金额不能为空");
		return;
	}
	if(status==null||status.trim()==''){
		alert("状态不能为空");
		return;
	}
	if(activeTimeBegin==null||activeTimeBegin.trim()==''){
		alert("有效期开始时间不能为空");
		return;
	}
	if(activeTimeBegin==null||activeTimeBegin.trim()==''){
		alert("有效期结束时间不能为空");
		return;
	}
	
	
	
	window.location.href=$("#ctx").val()+"/user/recharge/add?"
			+"listCode="+listCode
			+"&listDesc="+listDesc
			+"&amount="+amount
			+"&giveAmount="+giveAmount
			+"&status="+status
			+"&activeTimeBegin="+activeTimeBegin
			+"&activeTimeEnd="+activeTimeEnd
			;
	
}

</script>

<%@ include file="../footer.jsp"%>





